﻿using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using LearningProject.DataContract;
using System.ComponentModel;

namespace LearningProject.Interface
{
        [ServiceContract(Namespace = "zhangweiwen867@163.com")]
        public interface IEmployeesService
        {
                [WebGet(UriTemplate = "all", ResponseFormat = WebMessageFormat.Json)]
                [Description("获取所有员工列表")]
                IEnumerable<Employee> GetAll();

                [WebGet(UriTemplate = "{id}", ResponseFormat = WebMessageFormat.Json)]
                [Description("根据Id获取员工")]
                Employee Get(string id);

                [WebInvoke(UriTemplate = "/", Method = "POST", ResponseFormat = WebMessageFormat.Json)]
                [Description("创建员工")]
                Employee Create(Employee employee);

                [WebInvoke(UriTemplate = "/", Method = "PUT", ResponseFormat = WebMessageFormat.Json)]
                [Description("更新单个员工")]
                void Update(Employee employee);

                [WebInvoke(UriTemplate = "{id}", Method = "DELETE", ResponseFormat = WebMessageFormat.Json)]
                [Description("根据Id删除单个员工")]
                void Delete(string id);
        }
}
